<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>위험식별</title>
<script type="text/javascript" src="script/sms_riskI_script.js"></script>
<script type="text/javascript" src="script/sms_util_script.js"></script>
<link href="reset.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--말 줄임 css(모든 브라우저 적용)-->
<style type="text/css">
.ellipsis{
	white-space:nowrap;
	text-overflow:ellipsis;		/* IE, Safari */
	-o-text-overflow:ellipsis;		/* Opera under 10.7 */
	overflow:hidden;			/* "overflow" value must be different from "visible" */ 
	-moz-binding: url('ellipsis.xml#ellipsis');
}
</style>

<script type="text/javascript">
function winClose(){
	window.close();
}
function left(page,ascu_id,asc_id){
	location.href="riskIAction.do?mode=mridenty_insertPage&page="+page+"&ascu_id="+ascu_id+"&asc_id="+asc_id;
}
function right(page,ascu_id,asc_id){
	location.href="riskIAction.do?mode=mridenty_insertPage&page="+page+"&ascu_id="+ascu_id+"&asc_id="+asc_id;
}
</script>
</head>
<body>
<c:if test="${sessionScope.USER_ID==null}">
		<script type="text/javascript">
			alert("연결이 끊어졌습니다. 다시 로그인 해주시기 바랍니다");
			window.close();
		</script>	
</c:if>
<c:choose>
	<c:when test="${requestScope.ascList=='N'}">
		<script type="text/javascript">
		alert("기밀 등급 생성후 다시 이용바랍니다");
			window.close();
		</script>	
	</c:when>
	<c:when test="${requestScope.ascuList=='N'}">
		<script type="text/javascript">
		alert("보안 등급 생성후 다시 이용바랍니다");
			window.close();
		</script>	
	</c:when>
	<c:otherwise>
	
	
	<div class="box">
      		<h4 class="white">
      			<span class="align-left">위험식별</span>
	      		<span class="align-right">마감상태(위험식별) :
		      		<c:choose>
		      			<c:when test="${sessionScope.magamSession[2].state =='Y'}">
		      				 마감
		      			</c:when>
		      			<c:otherwise>
		      				 착수
		      			</c:otherwise>
		      		</c:choose>
	      		</span>
      		</h4>
        <div class="box-container1" style="display:;height: 100%;" id="boxContainer">     		
		 <form action="riskIAction.do" method="post" name="mridenty">
			<input type="hidden" name="mode" value="mridenty_insert"></input>
			<input type="hidden" name="pro_id" id="pro_id" value="${sessionScope.lastProId }"></input>
        	<table class="table-long">
        	<colgroup>
        		<col/>
        		<col width="390px"/>
        		<col width="165px"/>
        	</colgroup>
        	
      			<tfoot>
      				<tr>
      					<td>
      						<div class="align-left subjectTitle"> ■ 관리대상 위험선정기준</div>
      					</td>
      					<td class="col-rowspanMid col-alignCenter">
							<a href="#" class="button1"><span>보안등급</span></a>&nbsp;&nbsp;
      							<!-- 보안등급 -->
								<select name="ascu_id" id="ascu_id" class="selectBox" onchange="javascript: changeMridentyPage()" style="width: 100px;">
									<c:choose>
										<c:when test="${fn:length(requestScope.ascuList)== 0}">
											<option selected="selected" value="0">0등급</option>
										</c:when>
										<c:otherwise>
											<c:forEach  var="ascuList" items="${requestScope.ascuList}" varStatus="status">
											<option <c:if test="${ascuList.ascu_id == param.ascu_id }">selected</c:if> value="${ascuList.ascu_id }">${ascuList.ascu_level } 까지</option>
										</c:forEach>
										</c:otherwise>
									</c:choose>
								</select>
							<a href="#" class="button1"><span>기밀등급</span></a>&nbsp;&nbsp;
      							<!-- 기밀등급 -->
								<select name="asc_id" id="asc_id" class="selectBox" onchange="javascript: changeMridentyPage()" style="width: 100px;">
									<c:choose>
										<c:when test="${fn:length(requestScope.ascList)== 0}">
											<option selected="selected" value="0">0급비밀</option>
										</c:when>
										<c:otherwise>
											<c:forEach  var="ascList" items="${requestScope.ascList}" varStatus="status">
												<option <c:if test="${ascList.asc_id == param.asc_id }">selected</c:if> value="${ascList.asc_id }">${ascList.asc_level } 까지</option>
											</c:forEach>
										</c:otherwise>
									</c:choose>
								</select>
      					</td>
      					<td>
   							<div class="align-right" id="aTagDiv1">
		                     	<c:choose>
		                       		<c:when test="${sessionScope.magamSession[2].state !='Y'}">
		                       		<!-- 마감 현황이 유무 판별(Y 시 입력 불가) -->
		                     			<a href="#" class="button" onclick="javascript: mridentyInsert()"><span>저장</span></a>
		                       		</c:when>
		                       		<c:otherwise>
		                       			<a href="#" class="button1 addMargin" onclick="return false;"><span>저장</span></a>
		                       		</c:otherwise>
		                       	</c:choose>
		                     	 <a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a>
	                     	</div>
	                     	<div class="align-right" id="aTagDiv2" style="display:none">
	                       			<a href="#" class="button1 addMargin" onclick="return false;"><span>저장</span></a>
		                     	 <a href="#" class="button" onclick="javascript: winClose()"><span>닫기</span></a>
	                     	</div>
      					</td>
      				</tr>
      				<tr>
      				<td class="spaceLine" colspan="3"></td>
      				</tr>
      			</tfoot>
      		</table>
      		<table class="table-long">
      			<colgroup>
					<col width="40px"/>
					<col width="40px"/>
					<col width="120px"/>
					<col/>
					<col width="60px"/>
					<col width="60px"/>
					<col/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<thead>
      				<tr>
      					<td class="col-chk"><input type='checkbox' name='checkAll' onclick="javascript: selectAll()" class="chkCursor"></input></td>
      					<td>No</td>
      					<td>자산코드</td>
      					<td>자산명칭</td>
      					<td>기밀등급</td>
      					<td>보안등급</td>
      					<td>위협명</td>
      					<td>취약성명</td>
      					<td></td>
      				</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV" style="height: 325px;">
      		<table class="table-long">
      			<colgroup>
					<col width="40px"/>
					<col width="40px"/>
					<col width="120px"/>
					<col/>
					<col width="60px"/>
					<col width="60px"/>
					<col/>
					<col/>
					<col width="15px"/>
				</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(lvo.list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.lvo.list}" varStatus="status">
                   			<%--
                   			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
                   			 --%>
                   			  <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
                    			<!-- <td class="col-chk"><input type="checkbox" class="chkCursor" name="check" id="check${status.index+1 }" value='${list.hiddenCode}|${list.raitem_id }'></input></td> -->
                    			<td class="col-chk"><input type="checkbox" class="chkCursor" name="check" id="check${status.index+1 }" value='${list.hiddenCode}'></input></td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.rowNum }">${list.rowNum }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.raitem_id }">${list.raitem_id }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title='${list.raitem_nm }'>${list.raitem_nm }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;">${list.ascu_level }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;">${list.asc_level }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.tk_nm3 }">${list.tk_nm3 }</div>
                    			</td>
                    			<td>
                    				<div class="ellipsis"  style="width:100%;" title="${list.v_nm }">${list.v_nm }</div>
                    			</td>
	   					 	<td></td>
                    		</tr>
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td style="text-align: center; height: 35px ; vertical-align: middle; " colspan="8" valign="middle" class="col-first">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>
      		</div>
      		<table class="table-long">
   				<thead>
   					<tr>
   						<td  style="height: 25px ; vertical-align: middle;" valign="middle" >총 위험수 : ${requestScope.scenarioCount }</td>
   					</tr>
   				</thead>
           </table>  	
      		</form>
      		
      		<div style="text-align: center; display:" id="pageDiv">
      				<c:if test="${requestScope.lvo.pagingBean.previousPageGroup}">
						<img style="cursor: pointer;" src="img/left_arrow_btn.gif" border="0" onclick="left('${requestScope.lvo.pagingBean.startPageOfPageGroup-1}','${param.ascu_id }','${param.asc_id }')"></img>
					</c:if>
					<c:forEach var="i" begin="${requestScope.lvo.pagingBean.startPageOfPageGroup}" end="${requestScope.lvo.pagingBean.endPageOfPageGroup}">
					<c:choose>
						<c:when test="${requestScope.lvo.pagingBean.nowPage!=i}">
										<a href="riskIAction.do?mode=mridenty_insertPage&ascu_id=${param.ascu_id }&asc_id=${param.asc_id }&page=${i }" class="nor">${i }</a>
						</c:when>
						<c:when test="${requestScope.lvo.pagingBean.endPageOfPageGroup!=1}">
							${i }
						</c:when>
					</c:choose>
					</c:forEach>
					<c:if test="${requestScope.lvo.pagingBean.nextPageGroup}">
						<img style="cursor: pointer;" src="img/right_arrow_btn.gif" border="0" onclick="right('${requestScope.lvo.pagingBean.endPageOfPageGroup+1}','${param.ascu_id }','${param.asc_id }')"></img>
					</c:if>
      		</div>
      		
      	</div><!-- end of div.box-container1 -->
      	
      	<div id="show" style="position:absolute; top:48%; left:40%;"></div>
      	</div> <!-- end of div.box -->
	
	
	
	
	</c:otherwise>
</c:choose>




</body>
</html>